﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link rel="stylesheet" href="../layui/css/layui.css"  media="all">
<link href="../css/base.css" rel="stylesheet" type="text/css" />
<link href="../css/layout.css" rel="stylesheet" type="text/css" />
<script src="../js/jquery-1.8.3.min.js"></script>
<script src="../js/layer/layer.js"></script>
</head>

<body>
<div class="Export">
  <div class="mar">
  <div class="dis">
    <table width="580" border="0" cellspacing="0" cellpadding="0" class="con">
      <tr>
        <th width="126">账单编号：</th>
        <td width="454"><div class="layui-inline">
            <input class="layui-input" id="iThebtn" value="请输入账单编号"  style="color: #ccc;" onfocus="if(this.value=='(请输入账单编号)'){this.value=''};this.style.color='#333';" onblur="if(this.value==''||this.value=='(请输入账单编号)'){this.value='(请输入账单编号)'};this.style.color=#ccc;">
          </div></td>
      </tr>
    </table>
  </div>
  
  <div class="btn">
      <div class="ext"><a href="#"><span style="padding-left: 15px;">生成结账账单</span></a></div>
      </div>
      </div>
</div>
<script type="text/javascript" src="../layui/layui.js"></script> 
<script src="../js/jquery-1.8.3.min.js"></script>
<script>
layui.use('laydate', function(){
  var laydate = layui.laydate;
  
  var start = {
    min: laydate.now()
    ,max: '2099-06-16 23:59:59'
    ,istoday: false
    ,choose: function(datas){
      end.min = datas; //开始日选好后，重置结束日的最小日期
      end.start = datas //将结束日的初始值设定为开始日
    }
  };
  
  var end = {
    min: laydate.now()
    ,max: '2099-06-16 23:59:59'
    ,istoday: false
    ,choose: function(datas){
      start.max = datas; //结束日选好后，重置开始日的最大日期
    }
  };
  
  document.getElementById('LAY_demorange_s').onclick = function(){
    start.elem = this;
    laydate(start);
  }
  document.getElementById('LAY_demorange_e').onclick = function(){
    end.elem = this
    laydate(end);
  }
  
});
function getZz(){
	var iThebtn = document.getElementById("iThebtn");
	var str = iThebtn.value;
	var reg = /^1[3|4|5|6|7|8]\d{9}$/;
	var res = reg.test(str);
		if (!res) {
				iThealert()
		}else if (res) {
			iThealert2()
		};
}
$('.btn').click(function(){
	getZz();
})
$('.btn').click(iThealert);
function iThealert(){
	layer.open({
        type: 1
        ,title: '作废操作' //不显示标题栏
        ,closeBtn: false
        ,area: '300px;'
        ,shade: 0.2
        ,id: 'LAY_layuipro' //设定一个id，防止重复弹出
        ,btn: ['确定', '取消']
        ,moveType: 0 //拖拽模式，0或者1
        ,content: '<div style="padding: 30px 40px 30px 70px; line-height: 22px; background:#fff url(../images/ico/caution.png) 20px 40px no-repeat; color: #000; font-weight: 300;">您的输入有误</div>'
        ,success: function(layero){
          var btn = layero.find('.layui-layer-btn');
          btn.css('text-align', 'center');
        }
      });
}
function iThealert2(){
	layer.open({
        type: 1
        ,title: '提示' //不显示标题栏
        ,closeBtn: false
        ,area: '300px;'
        ,shade: 0.2
        ,id: 'LAY_layuipro' //设定一个id，防止重复弹出
        ,btn: ['确定', '取消']
        ,moveType: 0 //拖拽模式，0或者1
        ,content: '<div style="padding: 30px 40px 30px 70px; line-height: 22px; background:#fff url(../images/ico/ture.png) 20px 40px no-repeat; color: #000; font-weight: 300;">是否确定生成结账账单</div>'
        ,success: function(layero){
          var btn = layero.find('.layui-layer-btn');
          btn.css('text-align', 'center');
        }
      });
}
</script>
</body>
</html>
